﻿
namespace CalculatorLib
{
    public interface IPiWebService
    {
        float GetPi();
        float GetGravity(string location);
    }

    public class MathLib
    {

        IPiWebService _ws;

        public MathLib(IPiWebService ws)
        {
            _ws = ws;
        }

        public MathLib()
        {
            _ws = new PiWebService();
        }


        //Compute the circumference of a circle
        public float ComputeCircumference(float radius)
        {
            float pi = _ws.GetPi();
            return 2 * pi * radius;
        }

        //Compute the circumference of a circle
        public float CalculateMass(float weight, string location)
        {
            float gravity = _ws.GetGravity(location);
            return weight/gravity;
        }
    }
}
